#import "OmPersonalSettingVCAvatarView.h"
@interface OmPersonalSettingVCAvatarView ()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIView *separatorView;
@end
@implementation OmPersonalSettingVCAvatarView
- (void)configSelf {
    self.backgroundColor = [UIColor whiteColor];
}
- (void)allocateComponents {
    self.titleLabel = [[UILabel alloc] init].fp_text(ASLocalizedString(@"照片")).fp_font([UIFont systemFontOfSize:15 weight:UIFontWeightMedium]);
    [self addSubview:self.titleLabel];
    self.headImageView = (UIImageView *)[[UIImageView alloc] init].fp_cornerRadius(25).fp_clipsToBounds(YES);
    self.headImageView.fp_contentMode(UIViewContentModeScaleAspectFill);
    
//    if ([self.ID isEqualToString:curUser.id]) {
//        [self.headImageView sd_setImageWithURL:[NSURL URLWithString:curUser.avatar]];
//    }
    [self addSubview:self.headImageView];
    self.separatorView = [[UIView alloc] init].fp_backgroundColor(HexadecimalColor(@"#F2F2F2"));
    [self addSubview:self.separatorView];
}
- (void)layoutComponents {
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(28);
        make.left.equalTo(self).offset(22);
    }];
    [self.headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.equalTo(@(50));
        make.centerY.equalTo(self.titleLabel);
        make.right.equalTo(self).offset(-22);
    }];
    [self.separatorView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self);
        make.height.equalTo(@(11));
    }];
}

- (void)setToUserImageUrl:(NSString *)toUserImageUrl {
    _toUserImageUrl = toUserImageUrl;
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:toUserImageUrl]];
}

@end
